package com.test.bean;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
@Component("company")
@Scope("prototype")
public class Company {
    @Resource(name = "softwareEngineer")
    Enginer enginer;

    public Company(Enginer engineer){
        this.enginer = enginer;
    }
    public Company(){
        System.out.println("Company------------------------------");

    }

    public void run(){
        enginer.work();

    }

    public Enginer getEnginer() {
        return enginer;
    }

    public void setEnginer(Enginer enginer) {
        this.enginer = enginer;
    }
}
